﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Starfire3d.Data;
using Starfire3d.Data.Objects;
using Starfire3d.Interfaces;

namespace Starfire3d
{
    public static class DataFactory
    {
        public static IDataItem BuildDataItem(string objectType)
        {
            IDataItem newObj = null;

            switch (objectType)
            {
                case "ControlSheet":
                    newObj = new ControlSheet();
                    break;
                case "ShipClass":
                    newObj = new ShipClass();
                    break;
                case "WeaponSystem":
                    newObj = new WeaponSystem();
                    break;
                case "ShipSystem":
                    newObj = new ShipSystem();
                    break;
                default:
                    break;
            }

            if (newObj == null)
                throw new Exception("Unknown Data File Type.");

            return newObj;
        }
    }
}
